import { EntitySchema } from '@mikro-orm/core';

export class LePromoterZone {
  id!: string;
  UID!: string;
  isAdmin: boolean = false;
  name!: string;
  type: boolean = true;
  content!: string;
  picList!: string;
  videoList!: string;
  videoCover!: string;
  link!: string;
  AppID!: string;
  merchantId!: string;
  createdTime?: number = 0;
  updatedTime?: number = 0;
  deletedTime?: number = 0;
  isDeleted?: number = 0;
}

export const LePromoterZoneSchema = new EntitySchema({
  class: LePromoterZone,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    UID: { type: 'string', fieldName: 'UID', columnType: 'bigint' },
    isAdmin: { type: 'boolean', default: false },
    name: { type: 'string', length: 10 },
    type: { type: 'boolean', default: true },
    content: { type: 'string', length: 200 },
    picList: { type: 'string', length: 2048 },
    videoList: { type: 'string', length: 512 },
    videoCover: { type: 'string', length: 512 },
    link: { type: 'string', length: 5096 },
    AppID: { type: 'string', fieldName: 'AppID', length: 50 },
    merchantId: { type: 'string', columnType: 'bigint' },
    createdTime: { type: 'number', nullable: true, default: 0 },
    updatedTime: { type: 'number', nullable: true, default: 0 },
    deletedTime: { type: 'number', nullable: true, default: 0 },
    isDeleted: { type: 'number', columnType: 'tinyint', nullable: true, default: 0 },
  },
});
